//
//  DKLoginRegisterAccountView.m
//  DanKU
//
//  Created by 吴斌 on 2023/9/18.
//

#import "DKLoginRegisterAccountView.h"

@implementation DKLoginRegisterAccountView
-(instancetype)init{
    if(self == [super init]){
        self.backgroundColor = UIColor.clearColor;
        [self dk_addSubView];
    }
    return self;
}
- (void)dk_addSubView{
    UILabel *dk_RegisterAccountHeadLab = [[UILabel alloc] init];
    dk_RegisterAccountHeadLab.textColor = DK_Hex(@"#999999");
    dk_RegisterAccountHeadLab.font = DK_FONT_Medium(15);
    dk_RegisterAccountHeadLab.text = @"I have an account,";
    [self addSubview:dk_RegisterAccountHeadLab];
    [dk_RegisterAccountHeadLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@(DK_IsWidthScale(30)));
        make.top.equalTo(@(DK_IsWidthScale(0)));
        make.bottom.equalTo(@(-DK_IsWidthScale(0)));
    }];
    UIButton * dk_RegisterGoAccountBtn = [[UIButton alloc] init];
    [dk_RegisterGoAccountBtn setTitle:@"Go to login>" forState:UIControlStateNormal];
    [dk_RegisterGoAccountBtn setTitleColor:DK_Hex(@"#4566FF") forState:UIControlStateNormal];
    dk_RegisterGoAccountBtn.titleLabel.font = DK_FONT_Medium(15);
    [dk_RegisterGoAccountBtn addTarget:self action:@selector(goAccountLogin) forControlEvents:UIControlEventTouchUpInside];
    [self addSubview:dk_RegisterGoAccountBtn];
    [dk_RegisterGoAccountBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(dk_RegisterAccountHeadLab.mas_right);
        make.top.equalTo(@(DK_IsWidthScale(0)));
        make.bottom.equalTo(@(-DK_IsWidthScale(0)));
    }];
}
//去账号登录
- (void)goAccountLogin{
    if(self.goAccountLoginBlock){
        self.goAccountLoginBlock();
    }
}
@end
